{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Users/krzysztofkrakowski/Dropbox/Kosovo project/2_Orders/4_Writing/JEPS_final/replication/stata_logs/4_pakistan.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}30 Mar 2023, 09:50:14

{com}. do /var/folders/gm/8c3mn4mj2f5156vhvm1cmcym0000gp/Tselectedlines_piupiu.do
{txt}
{com}. ********************************************************************************
. *                                                                              *
. *           WHY DO PEOPLE USE INFORMAL JUSTICE? REPLICATION (JEPS)             *
. *                                                                              *
. ********************************************************************************
. 
.   
. 
. * define data and results paths (fill in with your own URL)
. global PathData = "/Users/krzysztofkrakowski/Dropbox/Kosovo project/2_Orders/1_Data/"
{txt}
{com}. global PathTab = "/Users/krzysztofkrakowski/Dropbox/Kosovo project/2_Orders/4_Writing/z_tables/to_edit/"
{txt}
{com}. 
. * upload the main data file (with original survey)
. use "${c -(}PathData{c )-}fata_data.dta", clear
{txt}
{com}. 
. 
. * create reliance on informal justice measure
. gen informal_justice = 1 if tribal_eld==1 | relig_leader==1
{txt}(325 missing values generated)

{com}. replace informal_justice = 0  if tribal_eld==0 & relig_leader==0
{txt}(325 real changes made)

{com}. 
. * create resourcelessness measure (by first dividing month household income by family size, and second taking a log of it and reversing the variable)
. gen mont_inc_cap = mont_inc/fam_size
{txt}
{com}. gen lnmont_incm = ln(mont_inc_cap+1)
{txt}
{com}. gen Resourcelessness = lnmont_incm*(-1)
{txt}
{com}. 
. * create inefficiency measure
. gen Inefficiency = 0 if justice==1 & just_govt==2
{txt}(1,871 missing values generated)

{com}. replace Inefficiency = 0 if justice==1 & just_army==3
{txt}(147 real changes made)

{com}. replace Inefficiency = 1 if just_govt!=2 | just_army!=3
{txt}(2,774 real changes made)

{com}. 
. * create conventions measure
. bysort vill_code: egen Conventions=mean(informal_justice)
{txt}
{com}. 
. 
. * recode control (by reversing the scale)
. gen religiosity = religious_prac*(-1)
{txt}
{com}. 
. 
. * standardize and label
. zval Resourcelessness Inefficiency Conventions informal_justice
{txt}
{com}. label variable z_Resourcelessness "Resourcelessness"
{txt}
{com}. label variable z_Inefficiency "Inefficiency"
{txt}
{com}. label variable z_Conventions "Conventions"
{txt}
{com}. 
. 
. * Table A12
. eststo clear
{txt}
{com}. eststo Informal_Justice: reghdfe z_informal z_Resourcelessness z_Inefficiency z_Conventions religiosity i.religion i.education age i.sex fam_size i.marital_stat, abs(agency_code)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     2,798
{txt}Absorbing 1 HDFE group{col 51}F({res}  18{txt},{res}   2769{txt}){col 67}= {res}     73.78
{txt}{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.3575
{txt}{col 51}Adj R-squared{col 67}= {res}    0.3511
{txt}{col 51}Within R-sq.{col 67}= {res}    0.3241
{txt}{col 51}Root MSE{col 67}= {res}    0.8056

{txt}{hline 19}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}z_informal_justice{col 20}{c |}      Coef.{col 32}   Std. Err.{col 44}      t{col 52}   P>|t|{col 60}     [95% Con{col 73}f. Interval]
{hline 19}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
z_Resourcelessness {c |}{col 20}{res}{space 2}-.0318079{col 32}{space 2} .0172201{col 43}{space 1}   -1.85{col 52}{space 3}0.065{col 60}{space 4}-.0655734{col 73}{space 3} .0019576
{txt}{space 4}z_Inefficiency {c |}{col 20}{res}{space 2}  .027315{col 32}{space 2} .0156233{col 43}{space 1}    1.75{col 52}{space 3}0.081{col 60}{space 4}-.0033196{col 73}{space 3} .0579495
{txt}{space 5}z_Conventions {c |}{col 20}{res}{space 2} .5734029{col 32}{space 2} .0171767{col 43}{space 1}   33.38{col 52}{space 3}0.000{col 60}{space 4} .5397225{col 73}{space 3} .6070834
{txt}{space 7}religiosity {c |}{col 20}{res}{space 2} .0289009{col 32}{space 2} .0188068{col 43}{space 1}    1.54{col 52}{space 3}0.124{col 60}{space 4}-.0079758{col 73}{space 3} .0657777
{txt}{space 8}2.religion {c |}{col 20}{res}{space 2} .0783756{col 32}{space 2} .0622545{col 43}{space 1}    1.26{col 52}{space 3}0.208{col 60}{space 4}-.0436943{col 73}{space 3} .2004455
{txt}{space 18} {c |}
{space 9}education {c |}
{space 16}1  {c |}{col 20}{res}{space 2} -.004407{col 32}{space 2} .0641464{col 43}{space 1}   -0.07{col 52}{space 3}0.945{col 60}{space 4}-.1301866{col 73}{space 3} .1213726
{txt}{space 16}2  {c |}{col 20}{res}{space 2}-.0155973{col 32}{space 2} .0551327{col 43}{space 1}   -0.28{col 52}{space 3}0.777{col 60}{space 4}-.1237027{col 73}{space 3}  .092508
{txt}{space 16}3  {c |}{col 20}{res}{space 2}-.0074541{col 32}{space 2} .0558509{col 43}{space 1}   -0.13{col 52}{space 3}0.894{col 60}{space 4}-.1169677{col 73}{space 3} .1020595
{txt}{space 16}4  {c |}{col 20}{res}{space 2}-.1009921{col 32}{space 2}  .055744{col 43}{space 1}   -1.81{col 52}{space 3}0.070{col 60}{space 4}-.2102962{col 73}{space 3}  .008312
{txt}{space 16}5  {c |}{col 20}{res}{space 2} .0131173{col 32}{space 2} .0893956{col 43}{space 1}    0.15{col 52}{space 3}0.883{col 60}{space 4}-.1621716{col 73}{space 3} .1884061
{txt}{space 16}6  {c |}{col 20}{res}{space 2}  .026061{col 32}{space 2} .0584622{col 43}{space 1}    0.45{col 52}{space 3}0.656{col 60}{space 4}-.0885729{col 73}{space 3} .1406948
{txt}{space 18} {c |}
{space 15}age {c |}{col 20}{res}{space 2} .0026012{col 32}{space 2} .0014681{col 43}{space 1}    1.77{col 52}{space 3}0.077{col 60}{space 4}-.0002775{col 73}{space 3}   .00548
{txt}{space 13}1.sex {c |}{col 20}{res}{space 2} .4281093{col 32}{space 2} .0800975{col 43}{space 1}    5.34{col 52}{space 3}0.000{col 60}{space 4} .2710524{col 73}{space 3} .5851662
{txt}{space 10}fam_size {c |}{col 20}{res}{space 2}-.0051619{col 32}{space 2} .0040063{col 43}{space 1}   -1.29{col 52}{space 3}0.198{col 60}{space 4}-.0130174{col 73}{space 3} .0026937
{txt}{space 18} {c |}
{space 6}marital_stat {c |}
{space 16}1  {c |}{col 20}{res}{space 2} .0299851{col 32}{space 2} .0439164{col 43}{space 1}    0.68{col 52}{space 3}0.495{col 60}{space 4}-.0561271{col 73}{space 3} .1160973
{txt}{space 16}2  {c |}{col 20}{res}{space 2} .2509857{col 32}{space 2} .1528914{col 43}{space 1}    1.64{col 52}{space 3}0.101{col 60}{space 4} -.048807{col 73}{space 3} .5507784
{txt}{space 16}3  {c |}{col 20}{res}{space 2} .2150427{col 32}{space 2} .2303768{col 43}{space 1}    0.93{col 52}{space 3}0.351{col 60}{space 4}-.2366849{col 73}{space 3} .6667704
{txt}{space 16}4  {c |}{col 20}{res}{space 2}-2.956597{col 32}{space 2} .8089368{col 43}{space 1}   -3.65{col 52}{space 3}0.000{col 60}{space 4}-4.542778{col 73}{space 3}-1.370417
{txt}{space 18} {c |}
{space 13}_cons {c |}{col 20}{res}{space 2}-.4320774{col 32}{space 2}  .104847{col 43}{space 1}   -4.12{col 52}{space 3}0.000{col 60}{space 4}-.6376635{col 73}{space 3}-.2264912
{txt}{hline 19}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} agency_code{col 14}{c |}{space 1}       11{col 27}{space 1}        0{col 39}{result}{space 1}       11{col 53}{text} {col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. estadd local controls = "Yes"

{txt}added macro:
           e(controls) : "{res:Yes}"

{com}. esttab Informal_Justice using "${c -(}PathTab{c )-}TableA12.tex", b(3) se(3) star(* 0.1 ** 0.05 *** 0.01) drop(_cons) stats(controls r2 N, labels("Controls" "R-squared" "N")) label nodepvar mtitles title("Determinants of Informal Justice (Pakistan Data)") replace nonotes postfoot(" ")
{res}{txt}(output written to {browse  `"/Users/krzysztofkrakowski/Dropbox/Kosovo project/2_Orders/4_Writing/z_tables/to_edit/TableA12.tex"'})

{com}. 
. 
. 
. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Users/krzysztofkrakowski/Dropbox/Kosovo project/2_Orders/4_Writing/JEPS_final/replication/stata_logs/4_pakistan.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}30 Mar 2023, 09:50:28
{txt}{.-}
{smcl}
{txt}{sf}{ul off}